var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
// var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');

module.exports = {
  //插件项
  // plugins: [commonsPlugin],
  // plugins: [
  //   new webpack.optimize.UglifyJsPlugin({
  //     compress: {
  //       warnings: false
  //     }
  //   })
  // ],
  //页面入口文件配置
  entry: {
    main : './src/app/main.js'
  },
  //入口文件输出配置
  output: {
    // path: 'src/dist/',
    // filename: '[name].bundle.js'
    filename: '[name].[chunkhash:6].js'
  },
  // plugins: [new HtmlWebpackPlugin({
  //     title: 'My App',
  //     filename: './src/index.html'
  // })],
  module: {
    //加载器配置
    loaders: [
      { test: /\.css$/, loader: 'style-loader!css-loader' },
      { test: /\.js$/, loader: 'ng-annotate', include: ("src/app") },
      { test: /\.scss$/, loader: 'style!css!sass?sourceMap'},
      { test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
    ]
  },

  //其它解决方案配置
  // resolve: {
  //   root: 'bower_components', //绝对路径
  //   extensions: ['', '.js', '.json', '.scss'],
  //   alias: {
  //     AppStore : 'js/stores/AppStores.js',
  //     ActionType : 'js/actions/ActionType.js',
  //     AppAction : 'js/actions/AppAction.js'
  //   }
  // }
};
